﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ACC.Data.Entities.Common
{
    public class ClientResponse
    {
        public virtual string CmdName { get; set; }
        public virtual bool Result { get; set; }
        public virtual string Message { get; set; }

        public virtual Object Data { get; set; }

    }

    public class BarCodeList
    {
        public virtual int Area { get; set; }
        public virtual string Barcode { get; set; }

    }

    /// <summary>
    /// Step EWI 用于客户端HMI上显示PLC的一些统计信息
    /// </summary>
    public class ProductCount
    {
        public virtual int OK_COUNT { get; set; }
        public virtual int NOK_COUNT { get; set; }
        public virtual int SCARP_COUNT { get; set; }
        public virtual int PENDING_COUNT { get; set; }
        public virtual double CycleTime { get; set; }

    }

    public class ClientPartType
    {
        public virtual int PartTypeId { get; set; }
        public virtual String PartNo { get; set; }
        public virtual String Description { get; set; }
        public virtual int Sequence { get; set; }

    }

    public class ClientParttypeData
    {
        public virtual String Name { get; set; }
        public virtual String Description { get; set; }
        public virtual String Address { get; set; }
        public virtual String ValueType { get; set; }
        public virtual object Value { get; set; }

    }
    public class ClientProcData
    {
        public virtual String Name { get; set; }
        public virtual String Description { get; set; }
        public virtual String UpLimit { get; set; }
        public virtual String LowLimit { get; set; }
        public virtual String ValueType { get; set; }
        public virtual String Unit { get; set; }
        public virtual object Value { get; set; }
        public virtual String Address { get; set; }
        public virtual int Position { get; set; }

    }

    public class ClientBomItems
    {
        public virtual String PartNo { get; set; }
        public virtual String Rev { get; set; }
        public virtual String ItemPartNo { get; set; }
        public virtual String ItemRev { get; set; }
        public virtual String Qty { get; set; }
        public virtual String IDName { get; set; }
        public virtual String IDPattern { get; set; }
        public virtual String IDValue { get; set; }
        public virtual String Description { get; set; }
        public virtual int Sequence { get; set; }

        /// <summary>
        /// 增加OP字段 by chenchen 
        /// </summary>
        public virtual String OP { get; set; }

        /// <summary>
        /// 新增LeadNo by chenchen 
        /// </summary>
        public virtual bool LeadNo { get; set; }
    }

    public class ClientOperator
    {
        public virtual String OperatorId { get; set; }
        public virtual String Name { get; set; }
        public virtual String LoginTime { get; set; }
        public virtual String LogoutTime { get; set; }

        /// <summary>
        /// 界面显示内容值
        /// </summary>
        public string ShowValue 
        {
            get
            {
                return String.Format("{0}({1})", string.IsNullOrEmpty(Name) ? "NULL" : Name, 
                                                 string.IsNullOrEmpty(OperatorId) ? "NULL" : OperatorId);
            }
        }
    }

    public class ClientStnCfg
    {
        public virtual String Line { get; set; }
        public virtual String OP { get; set; }
        public virtual String STN { get; set; }
        public virtual String Description { get; set; }
        public virtual int Sequence { get; set; }
        public virtual List<ClientOperator> Operators { get; set; }
    }

    public class ClientFailureWord
    {
        public virtual String Name { get; set; }
        public virtual String Description { get; set; }
        public virtual String PLC_NAME { get; set; }
        public virtual String PLC_TAG_ADDR { get; set; }

        public virtual List<ClientFailureBit> StatusBits { get; set; }
    }

    public class ClientFailureBit
    {
        public virtual int Bit { get; set; }
        public virtual String Description { get; set; }
        /// <summary>
        /// 用于存放Defect位置信息，客户端设置Unload时返回
        /// </summary>
        public virtual String Location { get; set; }
        /// <summary>
        /// 对应的StatusWord/FailureWord的Name
        /// </summary>
        public virtual String Name { get; set; }
    }

    public class ClientParttypeTagCfg
    {
        public virtual String Name { get; set; }
        public virtual String Description { get; set; }
        public virtual String Value { get; set; }
    }

    public class ClientModelChangeResult
    {
        public virtual ClientPartType PartType { get; set; }
        public virtual List<ClientBomItems> BOMItems { get; set; }
        public virtual List<ClientProcData> ProcDatas { get; set; }
        public virtual List<ClientLotTrackItem> ComponentSet { get; set; }

        public virtual List<ClientParttypeData> PartTypeDatas { get; set; }

        //public virtual List<ClientFailureBit> StatusBits { get; set; }
        public virtual List<ClientFailureWord> StatusBits { get; set; }
        public virtual List<ClientParttypeTagCfg> PartTypeTag { get; set; }
        public virtual List<Object> Reserved1 { get; set; }
        public virtual List<Object> Reserved2 { get; set; }
    }

    public class ClientLoginResult
    {
        public virtual String Line { get; set; }
        public virtual ClientOperator Operator { get; set; }
        public virtual List<ClientStnCfg> Stations { get; set; }
    }

    public class ClientLotTrackItem
    {
        public virtual String ItemPartNo { get; set; }
        public virtual String ItemRev { get; set; }
        public virtual String Description { get; set; }
        public virtual String Lot { get; set; }
        public virtual String SLot { get; set; }
        public virtual String USN { get; set; }
        public virtual String FeederNo { get; set; }
        public virtual String Qty { get; set; }
        public virtual String Bin { get; set; }
        public virtual String DefaultQty { get; set; }
    }

    public class ClientWorkOrder
    {
        public virtual String ID { get; set; }
        public virtual String WONO { get; set; }
        public virtual String PONO { get; set; }
        public virtual String PartNo { get; set; }
        public virtual String PlanQuantity { get; set; }
        public virtual String Quantity { get; set; }
        public virtual String Status { get; set; }
    }

    public class ClientShiftCfg
    {
        public virtual DateTime FirstTime { get; set; }
        public virtual float Hours { get; set; }
        public virtual string ShiftName { get; set; }
        public virtual int ShiftOrder { get; set; }
        public virtual float ShiftStart { get; set; }
    }

    /// <summary>
    /// 已绑定的条码
    /// </summary>
    public class ClientBindedComponents
    {
        public virtual String IDName { get; set; }

        public virtual String IDValue { get; set; }
    }
}
